﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xiplayer.Helpers;

namespace hook
{
    static class GloableClass
    {
        #region 静态变量
        public static string AppName = "Xiplayer";//应用名      
        public static bool IsTclientOk = false;
        internal static string SysIniFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SysConfig.ini");
        internal static string TemIniFile = System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("TMP"), "SysConfig.ini");
        internal static string MedialibFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "docs\\medialib");
        public static System.Windows.Forms.Form mainf;
        public static System.Windows.Forms.Timer dtimer;//定时读取html中的config定时器，有时config会读取失败
        public static System.Windows.Forms.Timer dtreturnhome;//返回首页
        public static System.Windows.Forms.Timer dtautoadv;//播放屏保

        public static bool HttpEnable = false;//http服务默认端口
        public static string LocalHttport = "8080";//http服务默认端口
        public static bool HttpIsStart = false;

        public static string LogDays = "10";//日志保留天数

        //迅普532打印机
        public static string XP532_Port = "1";//532打印机端口

        public static Enum_TP_Type TP_Type = Enum_TP_Type.XP532;//类型
        public static string TP_Port_Str = "-1";//端口str
        public static int TP_Port_Int = -1; //端口int
        public static bool TP_Port_InitStatus = false; //是否初始化成功
        public static string TP_Port_InitMsg = ""; //初始化异常信息

               
        public static string TGOriBgPath = "";
        public static bool TGHasExcel = false;
        public static bool TGHasBg = false;
        public static string TGPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "docs\\somatosensory");
        public static string TGDesFilePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "docs\\somatosensory\\data.js");
        public static string TGDesBgPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "docs\\somatosensory\\bg.png");

        //操作系统
        public static string OSystem = "win7";
        //退出码
        public static string ExitCode = "cccddd";
        //退出密码
        public static string ExitPwd = "112233";
        //退出点击区域
        public static int ExitRangeValue = 100;
        //退出点击区域(密码)
        public static int ExitPwdRangeValue = 50;
        #endregion 


        #region 全局系统参数类，用于绑定      
        #endregion

        public static void mouseDownEvent()
        {
            //Gloable.GloableClass.lg.WriteLog("点击了左键");
            if (dtreturnhome != null && dtreturnhome.Tag != null)
            {
                if (dtreturnhome.Tag.ToString() == "true")
                {
                    if (dtreturnhome.Enabled)
                    {
                        dtreturnhome.Stop();
                    }
                    //GloableClass.lg.WriteLog("dtreturnhome");
                    dtreturnhome.Start();
                }
            }

            if (dtautoadv != null && dtautoadv.Tag != null)
            {
                if (dtautoadv.Tag.ToString() == "true")
                {
                    //(GloableClass.mainf as MainForm)
                    if (dtautoadv.Enabled)
                    {
                        dtautoadv.Stop();
                    }
                    //GloableClass.lg.WriteLog("dtautoadv");
                    dtautoadv.Start();
                }
            }

        }


    }

    public enum Enum_TP_Type
    {
        None,
        XP532
    }



}
